<!DOCTYPE html>
<html>
<head>
    <title>微信支付</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="initial-scale=1.0, width=device-width, user-scalable=no"/>

    <link rel="stylesheet" type="text/css" href="/mine/pay/css/zhifu.css">
    <script type="text/javascript" src="/mine/pay/js/jquery.min.js"></script>
    <script src="/js/common.js"></script>

    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css">



    <script type="text/javascript">
        $(function () {

            var lmDetail = JSON.parse(sessionStorage.getItem("lmDetail"));
            var lmContent = JSON.parse(sessionStorage.getItem("lmContent"));
            var user = JSON.parse(sessionStorage.getItem("user"));

            console.log(lmDetail);
            console.log(lmContent);

            var contentId=lmContent.id;
            var detailId=lmDetail.id;

            //获取当前用户id
            var userId=user.id;

            //判断成人儿童
            var caId = getParams().id;
            //console.log(caId);

            if(caId==1){
                var price=lmDetail.childPrice;
            }
            if(caId==2){
                var price=lmDetail.adultPrice;
            }

            console.log(price);
            //添加下面价格
            $(".ticketPrice").html(price);


            //出现浮动层
            $(".ljzf_but").click(function () {
                $(".ftc_wzsf").show();
            });


            //关闭浮动
            $(".close").click(function () {
                $(".ftc_wzsf").hide();
                $(".mm_box li").removeClass("mmdd");
                $(".mm_box li").attr("data", "");
                i = 0;
            });

            //数字显示隐藏
            $(".xiaq_tb").click(function () {
                $(".numb_box").slideUp(500);
            });
            $(".mm_box").click(function () {
                $(".numb_box").slideDown(500);
            });
            //----
            var i = 0;
            $(".nub_ggg li .zf_num").click(function () {

                if (i < 6) {
                    $(".mm_box li").eq(i).addClass("mmdd");
                    $(".mm_box li").eq(i).attr("data", $(this).text());
                    i++
                    if (i == 6) {
                        setTimeout(function () {
                            var data = "";
                            $(".mm_box li").each(function () {
                                data += $(this).attr("data");
                            });
                            $.get('/ticketPayPasswords',{passdata:data,userId:userId,detailId:detailId,caId:caId},function (data) {
                                if(data.success){
                                    $(".ftc_wzsf").hide();
                                    $(".mm_box li").removeClass("mmdd");
                                    $(".mm_box li").attr("data", "");
                                    i = 0;
                                    console.log("支付成功");
                                    $(document).dialog({
                                        type : 'confirm',
                                        style: 'IOS',
                                        titleText: '支付成功',
                                        content: '订单已生成',
                                        buttons: [
                                            {
                                                name: '确定',
                                                callback: function() {
                                                    window.location.href="/landmarkContent.html?id=" + contentId;
                                                }
                                            }
                                        ]
                                    });

                                }else{
                                    $(document).dialog({
                                        type : 'confirm',
                                        style: 'IOS',
                                        titleText: '支付失败',
                                        content: '密码错误',
                                        buttons: [
                                            {
                                                name: '确定',
                                                callback: function() {
                                                    window.location.reload();
                                                }
                                            }
                                        ]
                                    });
                                }
                            });
                        }, 100);
                    }
                    ;
                }
            });

            $(".nub_ggg li .zf_del").click(function () {
                if (i > 0) {
                    i--
                    $(".mm_box li").eq(i).removeClass("mmdd");
                    $(".mm_box li").eq(i).attr("data", "");
                }
            });

            $(".nub_ggg li .zf_empty").click(function () {
                $(".mm_box li").removeClass("mmdd");
                $(".mm_box li").attr("data", "");
                i = 0;
            });

        });
    </script>
</head>
<body>

<div class="header">
    <div class="all_w ">
        <div class="gofh">
            <a href="javascript:history.go(-1);">
                <img src="/mine/pay/images/jt_03.jpg"></a>
        </div>
    </div>
</div>
<div class="wenx_xx">
    <div class="mz">罗窝商城</div>
    <div class="zhifu_price ticketPrice">￥88.88</div>
</div>
</div>
<a href="javascript:void(0);" class="ljzf_but all_w  payAction">立即支付</a>
<!--浮动层-->
<div class="ftc_wzsf">
    <div class="srzfmm_box">
        <div class="qsrzfmm_bt clear_wl">
            <img src="/mine/pay/images/xx_03.jpg" class="tx close fl">
            <img src="/mine/pay/images/jftc_03.png" class="tx fl">
            <span class="fl">请输入支付密码</span></div>
        <div class="zfmmxx_shop">
            <div class="mz">门票商品</div>
            <div class="zhifu_price ticketPrice">￥88.88</div>
        </div>
        <ul class="mm_box">
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </div>
    <div class="numb_box">
        <div class="xiaq_tb">
            <img src="/mine/pay/images/jftc_14.jpg" height="10"></div>
        <ul class="nub_ggg">
            <li><a href="javascript:void(0);" class="zf_num">1</a></li>
            <li><a href="javascript:void(0);" class="zj_x zf_num">2</a></li>
            <li><a href="javascript:void(0);" class="zf_num">3</a></li>
            <li><a href="javascript:void(0);" class="zf_num">4</a></li>
            <li><a href="javascript:void(0);" class="zj_x zf_num">5</a></li>
            <li><a href="javascript:void(0);" class="zf_num">6</a></li>
            <li><a href="javascript:void(0);" class="zf_num">7</a></li>
            <li><a href="javascript:void(0);" class="zj_x zf_num">8</a></li>
            <li><a href="javascript:void(0);" class="zf_num">9</a></li>
            <li><a href="javascript:void(0);" class="zf_empty">清空</a></li>
            <li><a href="javascript:void(0);" class="zj_x zf_num">0</a></li>
            <li><a href="javascript:void(0);" class="zf_del">删除</a></li>
        </ul>
    </div>
    <div class="hbbj"></div>
</div>

</body>
</html>